package com.zmm.zebulon.module.system.biz.convert.social;

import com.zmm.zebulon.common.pojo.PageResult;
import com.zmm.zebulon.module.system.api.social.dto.SocialUserBindReqDTO;
import com.zmm.zebulon.module.system.api.social.dto.SocialUserUnbindReqDTO;
import com.zmm.zebulon.module.system.biz.controller.admin.socail.vo.SocialUserBindReqVO;
import com.zmm.zebulon.module.system.biz.controller.admin.socail.vo.SocialUserUnbindReqVO;
import com.zmm.zebulon.module.system.biz.controller.admin.socail.vo.user.SocialUserRespVO;
import com.zmm.zebulon.module.system.biz.dal.dataobject.social.SocialUserDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * description: 社交 用户 转换
 *
 * @author zebulon
 * package com.zmm.zebulon.module.system.biz.convert.social
 * name: SocialUserConvert
 * date 2024/1/8 23:42
 */
@Mapper
public interface SocialUserConvert {

    SocialUserConvert INSTANCE = Mappers.getMapper(SocialUserConvert.class);

    @Mapping(target = "socialType", source = "reqVO.type")
    SocialUserBindReqDTO convert(Long userId, Integer userType, SocialUserBindReqVO reqVO);

    SocialUserUnbindReqDTO convert(Long userId, Integer userType, SocialUserUnbindReqVO reqVO);

    SocialUserRespVO convert(SocialUserDO bean);

    List<SocialUserRespVO> convertList(List<SocialUserDO> list);

    PageResult<SocialUserRespVO> convertPage(PageResult<SocialUserDO> page);

}
